namespace GeoWeb.Demo.WorkDataConfig.Entity
{
    using System;
    using GeoWeb.DataContext;


    /// <summary>
    /// 表名：GeoWorkDay 主键列：
    /// </summary>
    [SerializableAttribute()]
    public partial class GeoWorkDay : Entity
    {

        protected String _CalName;

        protected DateTime? _BeginDT;

        protected Int32? _State;

        protected Int32 _ID;

        protected Int32? _Weekday;

        protected DateTime? _EndDT;

        protected Int32? _BeginYear;

        protected Int32? _BeginMonth;

        protected Int32? _BeginDay;

        protected Int32? _EndYear;

        protected Int32? _EndMonth;

        protected Int32? _EndDay;

        protected Int32? _DayOfWeek;

        protected DateTime? _AmStarTime;

        protected DateTime? _AmEndTime;

        protected DateTime? _PmStarTime;

        protected DateTime? _PmEndTime;

        public String CalName
        {
            get
            {
                return this._CalName;
            }
            set
            {
                this.OnPropertyValueChange(_.CalName, _CalName, value);
                this._CalName = value;
            }
        }

        public DateTime? BeginDT
        {
            get
            {
                return this._BeginDT;
            }
            set
            {
                this.OnPropertyValueChange(_.BeginDT, _BeginDT, value);
                this._BeginDT = value;
            }
        }

        public Int32? State
        {
            get
            {
                return this._State;
            }
            set
            {
                this.OnPropertyValueChange(_.State, _State, value);
                this._State = value;
            }
        }

        public Int32 ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                this.OnPropertyValueChange(_.ID, _ID, value);
                this._ID = value;
            }
        }

        public Int32? Weekday
        {
            get
            {
                return this._Weekday;
            }
            set
            {
                this.OnPropertyValueChange(_.Weekday, _Weekday, value);
                this._Weekday = value;
            }
        }

        public DateTime? EndDT
        {
            get
            {
                return this._EndDT;
            }
            set
            {
                this.OnPropertyValueChange(_.EndDT, _EndDT, value);
                this._EndDT = value;
            }
        }

        public Int32? BeginYear
        {
            get
            {
                return this._BeginYear;
            }
            set
            {
                this.OnPropertyValueChange(_.BeginYear, _BeginYear, value);
                this._BeginYear = value;
            }
        }

        public Int32? BeginMonth
        {
            get
            {
                return this._BeginMonth;
            }
            set
            {
                this.OnPropertyValueChange(_.BeginMonth, _BeginMonth, value);
                this._BeginMonth = value;
            }
        }

        public Int32? BeginDay
        {
            get
            {
                return this._BeginDay;
            }
            set
            {
                this.OnPropertyValueChange(_.BeginDay, _BeginDay, value);
                this._BeginDay = value;
            }
        }

        public Int32? EndYear
        {
            get
            {
                return this._EndYear;
            }
            set
            {
                this.OnPropertyValueChange(_.EndYear, _EndYear, value);
                this._EndYear = value;
            }
        }

        public Int32? EndMonth
        {
            get
            {
                return this._EndMonth;
            }
            set
            {
                this.OnPropertyValueChange(_.EndMonth, _EndMonth, value);
                this._EndMonth = value;
            }
        }

        public Int32? EndDay
        {
            get
            {
                return this._EndDay;
            }
            set
            {
                this.OnPropertyValueChange(_.EndDay, _EndDay, value);
                this._EndDay = value;
            }
        }

        public Int32? DayOfWeek
        {
            get
            {
                return this._DayOfWeek;
            }
            set
            {
                this.OnPropertyValueChange(_.DayOfWeek, _DayOfWeek, value);
                this._DayOfWeek = value;
            }
        }

        public DateTime? AmStarTime
        {
            get
            {
                return this._AmStarTime;
            }
            set
            {
                this.OnPropertyValueChange(_.AmStarTime, _AmStarTime, value);
                this._AmStarTime = value;
            }
        }

        public DateTime? AmEndTime
        {
            get
            {
                return this._AmEndTime;
            }
            set
            {
                this.OnPropertyValueChange(_.AmEndTime, _AmEndTime, value);
                this._AmEndTime = value;
            }
        }

        public DateTime? PmStarTime
        {
            get
            {
                return this._PmStarTime;
            }
            set
            {
                this.OnPropertyValueChange(_.PmStarTime, _PmStarTime, value);
                this._PmStarTime = value;
            }
        }

        public DateTime? PmEndTime
        {
            get
            {
                return this._PmEndTime;
            }
            set
            {
                this.OnPropertyValueChange(_.PmEndTime, _PmEndTime, value);
                this._PmEndTime = value;
            }
        }

        /// <summary>
        /// 获取实体对应的表名
        /// </summary>
        protected override Table GetTable()
        {
            return new Table<GeoWorkDay>("GeoWorkDay");
        }

        /// <summary>
        /// 获取实体中的标识列
        /// </summary>
        protected override Field GetIdentityField()
        {
            return _.ID;
        }

        /// <summary>
        /// 获取列信息
        /// </summary>
        protected override Field[] GetFields()
        {
            return new Field[] {
                        _.CalName,
                        _.BeginDT,
                        _.State,
                        _.ID,
                        _.Weekday,
                        _.EndDT,
                        _.BeginYear,
                        _.BeginMonth,
                        _.BeginDay,
                        _.EndYear,
                        _.EndMonth,
                        _.EndDay,
                        _.DayOfWeek,
                        _.AmStarTime,
                        _.AmEndTime,
                        _.PmStarTime,
                        _.PmEndTime};
        }

        /// <summary>
        /// 获取列数据
        /// </summary>
        protected override object[] GetValues()
        {
            return new object[] {
                        this._CalName,
                        this._BeginDT,
                        this._State,
                        this._ID,
                        this._Weekday,
                        this._EndDT,
                        this._BeginYear,
                        this._BeginMonth,
                        this._BeginDay,
                        this._EndYear,
                        this._EndMonth,
                        this._EndDay,
                        this._DayOfWeek,
                        this._AmStarTime,
                        this._AmEndTime,
                        this._PmStarTime,
                        this._PmEndTime};
        }

        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        protected override void SetValues(IRowReader reader)
        {
            if ((false == reader.IsDBNull(_.CalName)))
            {
                this._CalName = reader.GetString(_.CalName);
            }
            if ((false == reader.IsDBNull(_.BeginDT)))
            {
                this._BeginDT = reader.GetDateTime(_.BeginDT);
            }
            if ((false == reader.IsDBNull(_.State)))
            {
                this._State = reader.GetInt32(_.State);
            }
            if ((false == reader.IsDBNull(_.ID)))
            {
                this._ID = reader.GetInt32(_.ID);
            }
            if ((false == reader.IsDBNull(_.Weekday)))
            {
                this._Weekday = reader.GetInt32(_.Weekday);
            }
            if ((false == reader.IsDBNull(_.EndDT)))
            {
                this._EndDT = reader.GetDateTime(_.EndDT);
            }
            if ((false == reader.IsDBNull(_.BeginYear)))
            {
                this._BeginYear = reader.GetInt32(_.BeginYear);
            }
            if ((false == reader.IsDBNull(_.BeginMonth)))
            {
                this._BeginMonth = reader.GetInt32(_.BeginMonth);
            }
            if ((false == reader.IsDBNull(_.BeginDay)))
            {
                this._BeginDay = reader.GetInt32(_.BeginDay);
            }
            if ((false == reader.IsDBNull(_.EndYear)))
            {
                this._EndYear = reader.GetInt32(_.EndYear);
            }
            if ((false == reader.IsDBNull(_.EndMonth)))
            {
                this._EndMonth = reader.GetInt32(_.EndMonth);
            }
            if ((false == reader.IsDBNull(_.EndDay)))
            {
                this._EndDay = reader.GetInt32(_.EndDay);
            }
            if ((false == reader.IsDBNull(_.DayOfWeek)))
            {
                this._DayOfWeek = reader.GetInt32(_.DayOfWeek);
            }
            if ((false == reader.IsDBNull(_.AmStarTime)))
            {
                this._AmStarTime = reader.GetDateTime(_.AmStarTime);
            }
            if ((false == reader.IsDBNull(_.AmEndTime)))
            {
                this._AmEndTime = reader.GetDateTime(_.AmEndTime);
            }
            if ((false == reader.IsDBNull(_.PmStarTime)))
            {
                this._PmStarTime = reader.GetDateTime(_.PmStarTime);
            }
            if ((false == reader.IsDBNull(_.PmEndTime)))
            {
                this._PmEndTime = reader.GetDateTime(_.PmEndTime);
            }
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if ((obj == null))
            {
                return false;
            }
            if ((false == typeof(GeoWorkDay).IsAssignableFrom(obj.GetType())))
            {
                return false;
            }
            if ((((object)(this)) == ((object)(obj))))
            {
                return true;
            }
            return false;
        }

        public class _
        {

            /// <summary>
            /// 表示选择所有列，与*等同
            /// </summary>
            public static AllField All = new AllField<GeoWorkDay>();

            /// <summary>
            /// 字段名：CalName - 数据类型：String
            /// </summary>
            public static Field CalName = new Field<GeoWorkDay>("CalName");

            /// <summary>
            /// 字段名：BeginDT - 数据类型：Nullable`1
            /// </summary>
            public static Field BeginDT = new Field<GeoWorkDay>("BeginDT");

            /// <summary>
            /// 字段名：State - 数据类型：Nullable`1
            /// </summary>
            public static Field State = new Field<GeoWorkDay>("State");

            /// <summary>
            /// 字段名：ID - 数据类型：Int32
            /// </summary>
            public static Field ID = new Field<GeoWorkDay>("ID");

            /// <summary>
            /// 字段名：Weekday - 数据类型：Nullable`1
            /// </summary>
            public static Field Weekday = new Field<GeoWorkDay>("Weekday");

            /// <summary>
            /// 字段名：EndDT - 数据类型：Nullable`1
            /// </summary>
            public static Field EndDT = new Field<GeoWorkDay>("EndDT");

            /// <summary>
            /// 字段名：BeginYear - 数据类型：Nullable`1
            /// </summary>
            public static Field BeginYear = new Field<GeoWorkDay>("BeginYear");

            /// <summary>
            /// 字段名：BeginMonth - 数据类型：Nullable`1
            /// </summary>
            public static Field BeginMonth = new Field<GeoWorkDay>("BeginMonth");

            /// <summary>
            /// 字段名：BeginDay - 数据类型：Nullable`1
            /// </summary>
            public static Field BeginDay = new Field<GeoWorkDay>("BeginDay");

            /// <summary>
            /// 字段名：EndYear - 数据类型：Nullable`1
            /// </summary>
            public static Field EndYear = new Field<GeoWorkDay>("EndYear");

            /// <summary>
            /// 字段名：EndMonth - 数据类型：Nullable`1
            /// </summary>
            public static Field EndMonth = new Field<GeoWorkDay>("EndMonth");

            /// <summary>
            /// 字段名：EndDay - 数据类型：Nullable`1
            /// </summary>
            public static Field EndDay = new Field<GeoWorkDay>("EndDay");

            /// <summary>
            /// 字段名：DayOfWeek - 数据类型：Nullable`1
            /// </summary>
            public static Field DayOfWeek = new Field<GeoWorkDay>("DayOfWeek");

            /// <summary>
            /// 字段名：AmStarTime - 数据类型：Nullable`1
            /// </summary>
            public static Field AmStarTime = new Field<GeoWorkDay>("AmStarTime");

            /// <summary>
            /// 字段名：AmEndTime - 数据类型：Nullable`1
            /// </summary>
            public static Field AmEndTime = new Field<GeoWorkDay>("AmEndTime");

            /// <summary>
            /// 字段名：PmStarTime - 数据类型：Nullable`1
            /// </summary>
            public static Field PmStarTime = new Field<GeoWorkDay>("PmStarTime");

            /// <summary>
            /// 字段名：PmEndTime - 数据类型：Nullable`1
            /// </summary>
            public static Field PmEndTime = new Field<GeoWorkDay>("PmEndTime");
        }
    }
}
